package com.gzx.spring.db.service.impl;

import com.gzx.risk.core.pojo.CrossBinningInfo;
import com.gzx.spring.db.entity.CrossBinning;
import com.gzx.spring.db.mapper.CrossBinningMapper;
import com.gzx.spring.db.service.CrossBinningService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 交叉分箱映射表 服务实现类
 * </p>
 *
 * @author qinpeng
 * @since 2025-10-23
 */
@Service
public class CrossBinningServiceImpl extends ServiceImpl<CrossBinningMapper, CrossBinning> implements CrossBinningService {

    @Override
    public List<CrossBinningInfo> getCrossBiningInfo() {
        List<CrossBinning> list = this.list();
        List<CrossBinningInfo> crossBinningInfos = new ArrayList<>();
        for (CrossBinning crossBinning : list) {
            CrossBinningInfo crossBinningInfo = new CrossBinningInfo();
            BeanUtils.copyProperties(crossBinning, crossBinningInfo);
            crossBinningInfos.add(crossBinningInfo);
        }
        return crossBinningInfos;
    }
}
